package f3source.s1predefinedsource;

import org.apache.flink.api.common.serialization.SimpleStringSchema;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer;

import java.util.Properties;

public class s2predefinedsource {
    public static void main(String[] args) throws Exception{
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        Properties kapro = new Properties();
        kapro.put("bootstrap.servers","192.168.43.102:9092");

        DataStreamSource<String> kafstream = env.addSource(new FlinkKafkaConsumer<String>("test",new SimpleStringSchema(),kapro));

        kafstream.print();

        env.execute();

    }
}
